<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            let count = document.getElementById("count");
        // count.innerHTML = 1;
         // 定时调用：将一个函数每隔一段时间调用一次
         let num = 1;
         let timer = setInterval(function () {
         count.innerHTML = num ++;
         if(num == 666 ){
         // 关闭定时器
         clearInterval(timer);
         }
        }, 1000);
        }
    </script>
</head>
<body>
    <div class="" id="count"></div>
</body>
</html>